package cn.tannn.jdevelops.utils.validation.datetime;

/**
 * 时间regular
 * @see <a href="https://any-rule.vercel.app/">regular</a>
 * @author <a href="https://t.tannn.cn/">tan</a>
 * @date 2024/5/24 下午3:03
 */
public class DateTimeRegular {

    /**
     * yyyy-MM-dd HH:mm:ss
     */
    public static final String yyyy_MM_dd_HH_mm_ss = "^((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29)) (?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d$";

    /**
     * HH:mm:ss
     */
    public static final String HH_mm_ss = "([0-1]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$";


    /**
     * HH:mm
     */
    public static final String HH_mm = "([0-1]?[0-9]|2[0-3]):([0-5][0-9])$";

    /**
     *
     */
    public static final String yyyy_MM_dd = "((\\d{2}(([02468][048])|([13579][26]))[\\-]((((0?[13578])|(1[02]))[\\-]((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-]((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-]((0?[1-9])|([1-2][0-9])))))|(\\d{2}(([02468][1235679])|([13579][01345789]))[\\-]((((0?[13578])|(1[02]))[\\-]((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-]((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-]((0?[1-9])|(1[0-9])|(2[0-8]))))))";
}
